import lib.memoize

# pos: [a2, a3, a4, a5]

@lib.memoize.LruCache
def E(pos):
    # return the expected number of single sheet of paper for pos


    # Get probability
    a2, a3, a4, a5 = pos

    # Get value for this position
    e = 0.0
    if a2 + a3 + a4 + a5 == 1:
        e = 1.0

    result = 0.0
    for p, prob in GetNextPosition(pos):
        result += (e + E(p)) / prob

    print pos, result
    return result



def GetNextPosition(pos):
    # return (next pos, its probability )
    a2, a3, a4, a5 = pos
    prob = sum(pos)

    if (a2, a3, a4, a5) == (0, 0, 0, 1): return

    for i in xrange(a2):
        yield (a2-1, a3+1, a4+1, a5+1), prob
    for i in xrange(a3):
        yield (a2  , a3-1, a4+1, a5+1), prob
    for i in xrange(a4):
        yield (a2  , a3  , a4-1, a5+1), prob
    for i in xrange(a5):
        yield (a2  , a3  , a4  , a5-1), prob


def Solve():
    result = E((1, 1, 1, 1))
    return round(result, 6)

if __name__ == "__main__":
    print Solve()

